#include "StdAfx.h"
#include "../sgp/Settings.h"

namespace ja2{ namespace sgp
{
	char const * const Settings::APPLICATION_NAME = "Jagged Alliance 2 v1.13";

	Settings::Settings()
		: m_Sound(true, false), m_FullScreen(true, false)
	{
	}

	void Settings::set_resolution(std::uint_least8_t Type)
	{
		switch(Type)
		{
		case 0:
			std::get<0>(m_Resolution) = 640;
			std::get<1>(m_Resolution) = 480;
			break;
		case 1:
		default:
			std::get<0>(m_Resolution) = 800;
			std::get<1>(m_Resolution) = 600;
			break;
		case 2:
			std::get<0>(m_Resolution) = 1024;
			std::get<1>(m_Resolution) = 768;
			break;
		}
	}

	void Settings::set_resolution(std::uint_least16_t Width, std::uint_least16_t Height)
	{
		std::get<0>(m_Resolution) = Width;
		std::get<1>(m_Resolution) = Height;
	}

	void Settings::set_offset(std::uint_least16_t Width, std::uint_least16_t Height)
	{
		std::get<0>(m_Offset) = Width;
		std::get<1>(m_Offset) = Height;
	}

	std::uint_least16_t Settings::res_width() const
	{
		return std::get<0>(m_Resolution);
	}
	
	std::uint_least16_t Settings::res_height() const
	{
		return std::get<1>(m_Resolution);
	}

	std::uint_least16_t Settings::offset_width() const
	{
		return std::get<0>(m_Offset);
	}
	
	std::uint_least16_t Settings::offset_height() const
	{
		return std::get<1>(m_Offset);
	}

	bool Settings::is_full_screen() const
	{
		return std::get<0>(m_FullScreen);
	}
} /*sgp*/} /*ja2*/